﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace EBA.Framework
{
    /// <summary>
    /// 插件配置文件
    /// <eba>
    ///     <framework plugins="plugins">
    ///         <bundles>
    ///             <bundle id="" name="" version="" description="" context="BundleContext">
    ///                 <files>
    ///                     <file name=""></file>
    ///                 </files>
    ///             </bundle>
    ///              <bundle id="" name="" version=""  description=""  context="RemotingBundleContext">
    ///             </bundle>
    ///         </bundles>
    ///     </framework>
    /// </eba>
    /// </summary>
    public class FrameworkConfigurationSection : ConfigurationSection
    {
        /// <summary>
        /// 插件目录
        /// </summary>
        [ConfigurationProperty("plugins", IsRequired = false, DefaultValue = "plugins")]
        public string Plugins
        {
            get { return (string)this["plugins"]; }
            set { this["plugins"] = value; }
        }

        /// <summary>
        /// 已有插件列表
        /// </summary>
        [ConfigurationProperty("bundles", IsRequired = false)]
        public BundleConfigurationElementCollection Bundles
        {
            get
            {
                return (BundleConfigurationElementCollection)this["bundles"];
            }
            set
            {
                this["bundles"] = (object)value;
            }
        }
    }
}
